package com.dy.design_pattern_study.chain_of_responsibility_pattern.dome2.impl;

import com.dy.design_pattern_study.chain_of_responsibility_pattern.dome2.Handler;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-22
 * @Content
 */
public class ConcreteHandler1 extends Handler {
    @Override
    public void handleRequest(int request) {
        //这里对请求进行处理
        if (request >= 0 && request < 10) {
            System.out.println(printTemplate(request));
        } else if (successor != null) {
            //如果 请求不在处理范围内，则转移到下一个请求
            successor.handleRequest(request);
        }
    }
}
